*** .do file for Hunt and Miler (2023) - "How Modern Lawmakers Advertise Their Legislative Effectiveness to Constituents"
*** Ref.:  Ms. No. 230069R1

************ MAIN TEXT **************
use "hunt_miler_mylevel.dta"


******* Table 2 - Descriptive Statistics of Effectiveness Advertising Types
univar lawmaking_all_my
univar lawmaking_leg_my
univar lawmaking_proc_my
univar advocacy_all_my
univar advocacy_act_my
univar advocacy_exp_my
univar district_my
univar district_my
univar effective_all_my

*** Table 3 - Effects on Instances of Effectiveness Language in Legislator E-Newsletters, 2009-2021
nbreg lawmaking_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)
nbreg advocacy_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)
nbreg district_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)

*** Fig. 1 - Majority Status and Presidential Partisanship
nbreg lawmaking_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_white cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)
margins, at(in_majority=(0(1)1) same_potus=(0/1)) vsquish atmeans
nbreg advocacy_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_white cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)
margins, at(in_majority=(0(1)1) same_potus=(0/1)) vsquish atmeans
nbreg district_my les female nonwhite democrat ideology cd_safety cd_pct_race_white cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)
margins, at(in_majority=(0(1)1) same_potus=(0/1)) vsquish atmeans



************ SUPPLEMENTARY APPENDIX ************

*** Table A1 - Descriptive Statistics of Effectiveness Advertising Types (Newsletter as Unit of Observation)
use "hunt_miler_nllevel.dta"
univar lawmaking_all
univar lawmaking_leg
univar lawmaking_proc
univar advocacy_all
univar advocacy_act
univar advocacy_exp
univar district
univar effective_all

*** Table A2 - Full Models from Main Text, Including Effectiveness Subcategories
use "hunt_miler_mylevel.dta"
nbreg lawmaking_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)
nbreg lawmaking_leg_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)
nbreg lawmaking_proc_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)
nbreg advocacy_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)
nbreg advocacy_act_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)
nbreg advocacy_exp_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)
nbreg district_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount_my, cluster(bio_group)

*** Table A3 - Robustness at Newsletter Level
use "hunt_miler_nllevel.dta"
nbreg lawmaking_all les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount, cluster(bio_group)
nbreg lawmaking_leg les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount, cluster(bio_group)
nbreg lawmaking_proc les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount, cluster(bio_group)
nbreg advocacy_all les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount, cluster(bio_group)
nbreg advocacy_act les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount, cluster(bio_group)
nbreg advocacy_exp les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount, cluster(bio_group)
nbreg district les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad national_partisan2p ch_quality primary_opp election_year i.in_majority##i.same_potus chamber_leader cmte_chair terms_served retiring wordcount, cluster(bio_group)

*** Table A4 - Year Splits, 2009-2014
use "hunt_miler_mylevel.dta"
nbreg lawmaking_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year < 2015, cluster(bio_group)
nbreg lawmaking_leg_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year < 2015, cluster(bio_group)
nbreg lawmaking_proc_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year < 2015, cluster(bio_group)
nbreg advocacy_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year < 2015, cluster(bio_group)
nbreg advocacy_act_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year < 2015, cluster(bio_group)
nbreg advocacy_exp_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year < 2015, cluster(bio_group)
nbreg district_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year < 2015, cluster(bio_group)

*** Table A5 - Year Splits, 2015-2021
use "hunt_miler_mylevel.dta"
nbreg lawmaking_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year > 2015, cluster(bio_group)
nbreg lawmaking_leg_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year > 2015, cluster(bio_group)
nbreg lawmaking_proc_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year > 2015, cluster(bio_group)
nbreg advocacy_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year > 2015, cluster(bio_group)
nbreg advocacy_act_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year > 2015, cluster(bio_group)
nbreg advocacy_exp_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year > 2015, cluster(bio_group)
nbreg district_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my if year > 2015, cluster(bio_group)

*** Table A6 - Fixed Effects by Congress
use "hunt_miler_mylevel.dta"
xtset congress
xtnbreg lawmaking_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg lawmaking_leg_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg lawmaking_proc_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg advocacy_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg advocacy_act_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg advocacy_exp_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg district_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp election_year in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe

*** Table A7 - Fixed Effects by Calendar Year
use "hunt_miler_mylevel.dta"
xtset year
xtnbreg lawmaking_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg lawmaking_leg_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg lawmaking_proc_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg advocacy_all_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg advocacy_act_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg advocacy_exp_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
xtnbreg district_my les female nonwhite democrat ideology cd_safety cd_pct_race_nonwhite cd_median_income cd_pct_educ_undergrad  national_partisan2p ch_quality primary_opp in_majority chamber_leader cmte_chair terms_served retiring wordcount_my, fe
